// 引入二次封装的axios
import requests from "./ajax"
// 引入mock请求
import mockRequest from "./mockAjax"
// 发送请求获取数据
// 获取验证码请求 /api/user/passport/sendCode/{phone}
export const reqgetcode=(phone)=>requests({url:`/user/passport/sendCode/${phone}`,method:'get'})
// 注册用户  /api/user/passport/register  post
export const reqRegister=(data)=>requests({url:`/user/passport/register`,data,method:'post'})
// 用户登录  /api/user/passport/login
export const reqLogin=(data)=>requests({url:`/user/passport/login`,method:'post',data})
// 退出登录  /api/user/passport/logout get
export const reqLogout=()=>requests({url:`/user/passport/logout`,method:'get'})
// 获取用户信息  /api/user/passport/auth/getUserInfo  get
export const reqUserInfo=()=>requests({url:`/user/passport/auth/getUserInfo`,method:'get'})
// 获取购物车信息
export const reqShopCart=()=>requests({url:`/cart/cartList`,method:'get'})
// 获取首页轮播图数据
// Mock.mock("/mock/homeCarousel",homeCarousel)
export const reqGetcarousel =()=>mockRequest.get("/homeCarousel")

// 获取全部商品分类 ---全部
export const getGoodsCategory = ()=>mockRequest({
    url:"/goodsCategoryAll",
    method:"GET"
})

// 全部商品-----手机
export const getGoodsCategoryPhone = ()=>mockRequest({
    url:"/goodsCategoryPhone",
    method:"GET"
})

// 首页---手机
export const getHomePhoneData = ()=>mockRequest({
    url:"/homePhone",
    method:"GET"
})


// 全部商品 ---- 电视
export const getGoodsCategoryTv = ()=>mockRequest({
    url:"/goodsCategoryTV",
    method:"GET"
})

// 首页---家电
export const getHomeTVdata = ()=>mockRequest({
    url:"/homeTv",
    method:"GET"
})


// 首页---配件
export const getHomePartsData = () => mockRequest({
    url: "/homeCharge",
    method:"GET"
})
